<template>
  <div 
    class="stat-card" 
    :style="{ background: stat.gradient }"
    @mouseenter="startGlow"
    @mouseleave="stopGlow"
  >
    <div class="glow-effect" :style="glowStyle"></div>
    <i :class="stat.icon" class="stat-icon"></i>
    <div class="stat-content">
      <div class="value">{{ stat.value }}</div>
      <div class="label">{{ stat.label }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DashboardStatCard',
  props: {
    stat: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      glowOpacity: 0
    }
  },
  computed: {
    glowStyle() {
      return {
        opacity: this.glowOpacity,
        background: `radial-gradient(circle at 50% 0%, rgba(255,255,255,0.4) 0%, transparent 70%)`
      }
    }
  },
  methods: {
    startGlow() {
      this.glowOpacity = 0.3
    },
    stopGlow() {
      this.glowOpacity = 0
    }
  }
}
</script>

<style lang="scss" scoped>
.stat-card {
  position: relative;
  padding: 20px;
  border-radius: 10px;
  color: white;
  overflow: hidden;
  min-height: 120px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);

  .glow-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    transition: opacity 0.3s ease;
  }

  .stat-icon {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 2.5rem;
    opacity: 0.2;
    transition: opacity 0.3s ease;
  }

  .stat-content {
    position: relative;
    z-index: 1;
    
    .value {
      font-size: 2.2rem;
      font-weight: 700;
      line-height: 1;
      margin-bottom: 8px;
      text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    .label {
      font-size: 0.9rem;
      opacity: 0.9;
    }
  }

  &:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    
    .stat-icon {
      opacity: 0.3;
    }
  }
}

@media (max-width: 768px) {
  .stat-card {
    padding: 15px;
    
    .stat-icon {
      font-size: 2rem;
    }
    
    .value {
      font-size: 1.8rem;
    }
  }
}
</style> 